import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('@/pages/HomePage.vue'),
    },
    {
      path: '/user/login',
      name: '用户登录',
      component: () => import('@/pages/user/UserLoginPage.vue'),
    },
    {
      path: '/user/register',
      name: '用户注册',
      component: () => import('@/pages/user/UserRegisterPage.vue'),
    },
    {
      path: '/admin/user-manager',
      name: '用户管理',
      component: () => import('@/pages/admin/UserManagerPage.vue'),
    },
    {
      path: '/admin/picture-manager',
      name: '图片管理',
      component: () => import('@/pages/admin/PictureManagerPage.vue'),
    },
    {
      path: '/admin/space-manager',
      name: '空间管理',
      component: () => import('@/pages/admin/SpaceManagerPage.vue'),
    },
    {
      path: '/add-picture',
      name: '添加图片',
      component: () => import('@/pages/picture/AddPicturePage.vue'),
    },
    {
      path: '/add-picture/batch',
      name: '批量添加图片',
      component: () => import('@/pages/picture/AddBatchPicturePage.vue'),
    },
    {
      path: '/picture/:id',
      name: '图片详情',
      component: () => import('@/pages/picture/PictureDetailPage.vue'),
      props: true,
    },
    {
      path:"/add-space",
      name:"添加空间",
      component:()=>import('@/pages/space/AddSpacePage.vue')
    },
    {
      path:"/my-space",
      name:"我的空间",
      component:()=>import('@/pages/space/MySpacePage.vue')
    },
    {
      path:"/space/:id",
      name:"空间详情",
      component:()=>import('@/pages/space/SpaceDetailPage.vue'),
      props:true
    },
    {
      path:"/space-analyze",
      name:"空间分析",
      component:()=>import('@/pages/space/SpaceAnalyzePage.vue')
    },
    {
      path:"/search-picture",
      name:"搜索图片",
      component:()=>import('@/pages/picture/SearchPicturePage.vue')
    },
    {
      path:"/space-user-manager/:id",
      name:"空间成员管理",
      component:()=>import('@/pages/spaceuser/SpaceUserManager.vue'),
      props:true
    },
    {
      path:"/exchange-vip",
      name:"兑换VIP",
      component:()=>import('@/pages/user/UserExchangeVipPage.vue')
    }
  ],
})

export default router
